#ifndef __number__
#define __number__
#include <sstream>

class number: public object {
    double num;

public:
    number(double d = 0.0): object("", false), num(d) { }
    std::string to_string() {
	std::stringstream ss;
	ss << num;
	return ss.str();
    }
    std::string get_type() { return "#<Number>"; }
    double get_num() { return num; }
    void set_num(double d) { num = d; }
    void operator +=(Object obj) { num += obj->get_num(); }
    void operator -=(Object obj) { num -= obj->get_num(); }
    void operator *=(Object obj) { num *= obj->get_num(); }
    void operator /=(Object obj) { num /= obj->get_num(); }
    void operator %=(Object obj) { num = (int) num % (int) obj->get_num(); }
    bool operator ==(Object obj) { return num == obj->get_num(); }
    bool operator !=(Object obj) { return num != obj->get_num(); }
    bool operator <(Object obj) { return num < obj->get_num(); }
    bool operator >(Object obj) { return num > obj->get_num(); }
    bool operator <=(Object obj) { return num <= obj->get_num(); }
    bool operator >=(Object obj) { return num >= obj->get_num(); }
};
typedef boost::shared_ptr<number> Number;
#endif
